# main.py - 主程序入口
# coder DarionDong
# 判断是否有命令行参数

import sys
import os

def main():
    if len(sys.argv) > 1:
        # 命令行模式
        if sys.argv[1] == "service":
            from etbox_service import ETBOXService
            service = ETBOXService()
            service.run()
        elif sys.argv[1] == "upload":
            from etbox_client import handle_upload_request
            if len(sys.argv) > 2:
                handle_upload_request(sys.argv[2])
            else:
                print("错误: 未指定文件路径")
        elif sys.argv[1] == "gui":
            from etbox_gui import show_main_gui
            show_main_gui()
    else:
        # 默认启动GUI
        from etbox_gui import show_main_gui
        show_main_gui()

if __name__ == "__main__":
    main()